﻿using YAPACS.RisServer.Services.Dtos;
using YAPACS.Workflows;

namespace YAPACS.RisServer.Abstractions;

public interface IRegisterService
{
    /// <summary>
    /// 获取检查对象
    /// </summary>
    /// <param name="examId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> GetExamAsync(Guid examId);
    /// <summary>
    /// 获取检查form-view
    /// </summary>
    /// <param name="examId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> GetExamViewAsync(Guid examId);
    /// <summary>
    /// 创建检查对象
    /// </summary>
    /// <param name="deviceTypeId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> CreateAsync(Guid deviceTypeId);
    /// <summary>
    /// 保存检查
    /// </summary>
    /// <param name="examDto"></param>
    /// <returns></returns>
    Task<WorkflowOutput> SaveAsync(ExamDto examDto, string editReason);
    /// <summary>
    /// 提交检查
    /// </summary>
    /// <param name="examId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> SubmitAsync(Guid examId);
    /// <summary>
    /// 撤回提交
    /// </summary>
    /// <param name="input"></param>
    /// <param name="nextApi"></param>
    /// <returns></returns>
    Task<WorkflowOutput> RevokeAsync(WorkflowInput input, string nextApi = null);
    /// <summary>
    /// 删除检查
    /// </summary>
    /// <param name="input"></param>
    /// <param name="nextApi"></param>
    /// <returns></returns>
    Task<WorkflowOutput> DeleteAsync(WorkflowInput input, string nextApi = null);
    /// <summary>
    /// 快速查询检查列表
    /// </summary>
    /// <param name="request"></param>
    /// <returns></returns>
    Task<WorkflowOutput> GetExamListByFilterAsync(DataGridRequest request);

    Task<WorkflowOutput> ExportAsync(DataGridRequest request);
    /// <summary>
    /// 获取高级查询视图
    /// </summary>
    /// <returns></returns>
    Task<WorkflowOutput> GetAdvancedSearchViewAsync();
    /// <summary>
    /// 挂起
    /// </summary>
    /// <param name="examId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> PendingAsync(IList<Guid> examIds);
    /// <summary>
    /// 取消挂起
    /// </summary>
    /// <param name="examId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> CancelPendingAsync(IList<Guid> examIds);
    /// <summary>
    /// 退费
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task<WorkflowOutput> RefundAsync(WorkflowInput input, string nextApi = null);
    /// <summary>
    /// 设置到检
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task<WorkflowOutput> ArrivedAsync(WorkflowInput input, string nextApi = null);
    /// <summary>
    /// 置顶
    /// </summary>
    /// <param name="examId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> TopAsync(Guid examId);
    /// <summary>
    /// 置底
    /// </summary>
    /// <param name="examId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> BottomAsync(Guid examId);
    /// <summary>
    /// 置前
    /// </summary>
    /// <param name="examId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> PreviousAsync(Guid examId);
    /// <summary>
    /// 置后
    /// </summary>
    /// <param name="examId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> NextAsync(Guid examId);
    /// <summary>
    /// 紧急新建
    /// </summary>
    /// <returns></returns>
    Task<WorkflowOutput> EmergencyRegisterAsync();
    /// <summary>
    /// 转诊
    /// </summary>
    /// <param name="examIds"></param>
    /// <param name="roomId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> TransferRoomAsync(IList<Guid> examIds, Guid roomId);
}
